<div class="form-container">
<div class="validation-errors" id="validationErrors" style="display:none;"></div>
<div class="walk-register-buttons" style="float: right;">
	<a href="<?php echo( base_url() ); ?>cmb/member/homepage_logout/"><img src="<?php echo( base_url() ); ?>assets/images/buttons/logout1.gif" border="0" /></a>
</div>
<?php
	Includes::IncludeFile( Includes::$FORM );
	Includes::IncludeFile( Includes::$SPACER );
			
		echo( form_open(base_url() . 'cmb/member_reports/balavihar_class_attendance_report/' .$urlKey.'/', array('id' => 'balaviharClassAttendanceForm') ) );

		//Collect search parameters for Balavihar class attendance report
		//----------------------------------------
		Spacer::Render(0, 50);
		
		Form::OpenFormItem('Student Center:', 250);
			$centerOptions = array('Andover'=>'Andover', 'MetroWest'=>'MetroWest');
			echo( form_dropdown('centername', $centerOptions, 'All', 'id="centername" style="width: 100px;" ') );
		Form::CloseFormItem();

		Form::OpenFormItem('Student Session:',250);
			$centerOptions = array('AM'=>'AM', 'PM'=>'PM', 'PM2'=>'PM2');
			echo( form_dropdown('session', $centerOptions, 'All', 'id="session" style="width: 75px;" ') );
		Form::CloseFormItem();

		Form::OpenFormItem('Student Grade:', 250);
			$centerOptions = array('Pre-K'=>'Pre-K', 'K'=>'K', '1'=>'1', '2'=>'2', '3'=>'3', '4'=>'4', '5'=>'5', '6'=>'6', '7'=>'7', '8'=>'8', '9'=>'9', '10'=>'10', '11'=>'11', '12'=>'12');
			echo( form_dropdown('gradename', $centerOptions, 'All', 'id="gradename" style="width: 75px;" ') );
		Form::CloseFormItem();

		Form::OpenFormItem('Starting Month:', 250);
			$monOptions = array('all'=>'All', 'sep'=>'September', 'oct'=>'October', 'nov'=>'November', 'dec'=>'December', 'jan'=>'January', 'feb'=>'February', 'mar'=>'March', 'apr'=>'April', 'may'=>'May', 'jun'=>'June');
			echo( form_dropdown('month', $monOptions, 'All', 'id="month" style="width: 100px;" ') );
		Form::CloseFormItem();

		Form::OpenFormItem('Output Format:', 250);
			$ofOptions = array('1'=>'Monthly', '2'=>'Block', '3'=>'All');
			echo( form_dropdown('outputformat', $ofOptions, 'All', 'id="outputformat" style="width: 80px;" ') );
		Form::CloseFormItem();

		echo( form_close() );
?>
	<div class="form-button-container">
		<a href="javascript: validate();"><img src="<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif" border="0" onmouseover="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_over1.gif';" onmousedown="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_on1.gif';" onmouseup="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif';" onmouseout="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif';" />
	</div>	

</div>

<script type="text/javascript">
	function validate()
	{
		new Ajax.Request(baseUrl + 'validation/reports_validation/validate_balavihar_class_attendance/', 
		{
			method:'post',
			parameters: Form.serialize( $('balaviharClassAttendanceForm') ),
		  	onSuccess: function(response)
			{
				var result = response.responseText;
				
				if( result == 'VALIDATION_SUCCESS' )
				{
					$('balaviharClassAttendanceForm').submit();
				}
				else
				{
					$('validationErrors').innerHTML = result;
					$('validationErrors').show();
					Effect.ScrollTo('validationErrors', { duration:'0.2', offset:-20 });
				}
			},
			onFailure: function(response){var result = response.responseText; $('validationErrors').innerHTML = result;
					$('validationErrors').show();alert('failed') }
		});
	}
</script>
